.w-row.w-hidden-small.w-hidden-tiny.card.card-secondary
  .w-col.w-col-3
    .fontsize-small.fontweight-semibold= t('.contributed_projects') 
  .w-col.w-col-2
    .fontsize-small.fontweight-semibold= t('.contribution_value') 
  .w-col.w-col-3
    .fontsize-small.fontweight-semibold= t('.contribution_status') 
  .w-col.w-col-4
    .fontsize-small.fontweight-semibold= t('.reward') 

- collection.each do |contribution|
  - project = contribution.project
  - payment = contribution.payment
  .w-row.card
    .w-col.w-col-3
      .w-row
        .w-col.w-col-4.u-marginbottom-10
          = link_to (image_tag project.display_image, class: 'thumb-project u-radius', alt: project.name, width: 50), project_by_slug_path(project.permalink)
        .w-col.w-col-8
          .fontsize-small.fontweight-semibold= project.name
    .w-col.w-col-2.u-marginbottom-10
      .fontsize-base.inline-block
        span.w-hidden-main.w-hidden-medium.fontweight-semibold>= Contribution.human_attribute_name(:value)
        = contribution.decorate.display_value
    .w-col.w-col-3.u-marginbottom-10
      .w-hidden-main.w-hidden-medium.fontsize-smallest.fontweight-semibold>= Payment.human_attribute_name(:state)
      .fontsize-smallest 
        = "#{contribution.decorate.display_payment_details} #{contribution.decorate.display_installment_details}"
      - if project.failed? && contribution.paid? && contribution.slip_payment? && payment.is_pagarme? && !payment.already_in_refund_queue?
        = link_to t('.request_refund'), new_bank_account_path, class: "btn btn-inline btn-small u-margintop-10"
      - else
        .fontsize-smallest
          = contribution.decorate.display_status
        - if contribution.can_show_slip?
          = link_to t('.print_slip'), contribution.decorate.display_slip_url, class: 'btn btn-inline btn-small u-margintop-10', target: '__blank'
        - elsif contribution.can_generate_slip?
          = link_to t('.slip_copy'), second_slip_project_contribution_url(contribution.project, contribution.contribution), class: 'btn btn-inline btn-small u-margintop-10', target: '__blank'
      .w-checkbox.fontsize-smallest.fontcolor-secondary.u-margintop-10
        = check_box_tag :anonymous, "1", contribution.anonymous, class: 'w-checkbox-input', 
          data: { remote: true,
          url: toggle_anonymous_project_contribution_url(contribution.project, contribution.contribution) }
        label.w-form-label= t('.anonymous') 
    .w-col.w-col-4
      .fontsize-smallest
        span.w-hidden-main.w-hidden-medium.fontweight-semibold>= Contribution.human_attribute_name(:reward)
        - if contribution.reward
          = contribution.reward.display_description
        - else
          = t('.no_reward')
      - if contribution.reward.try(:display_deliver_estimate).present?
        .fontsize-smallest.lineheight-looser
          span.fontweight-semibold= t('.delivery_estimate') 
          =< contribution.reward.try(:display_deliver_estimate)
